<?php echo $html->script("comments_related"); ?>

<div class="users form">
	<h2><?php echo $blog['Blog']['subject']; ?></h2>	
	<fieldset>
		<p><?php echo $blog['Blog']['body']; ?></p>
		<br />
		<p class="times"><?php echo 'Created: ' .$blog['Blog']['created']; ?></p>
		<p class="times"><?php echo 'Modified: ' .$blog['Blog']['modified']; ?></p>
	</fieldset>
</div>
<div class="users form" id="comments">
	<h1>Comments</h1>
	<?php 
	if($comments){ 
	foreach($comments as $comment){ ?>
		<div class="comments" id="comment<?php echo $comment['Comment']['id']?>">
		<span class="userPic"><?php echo $html->image('profile/user/' .$user['User']['id']. '.jpg', array('width' => 75, 'height' => 75)); ?></span>
		<p class="comment_Uname"><?php echo $user['User']['first_name']; ?></p>
		<p class="comment"><?php echo $comment['Comment']['comment']; ?></p>
		<p class="times">Created: <?php echo $comment['Comment']['created']; ?></p><br />
		<?php
			echo $html->image('options_icon.jpg', array('width' => 15, 'height' => 15, 'class' => 'blog_options_icon'));
			if ($comment['Comment']['like'] == 1)
				echo ' <a class="unlike">Unlike</a> ';
			else 
				echo ' <a class="like">Like</a> ';
			
			if ($comment['Comment']['like_count'] > 0) {
				echo $html->image('thumbs_up.jpg', array('width' => 17, 'height' => 17, 'class' => 'thumbsUp',
					'id' => 'thumbsUp_' .$comment['Comment']['id']));
				echo ' ';
				echo '<a class="like_count" id="likeCountComment_' .$comment['Comment']['id']. '" title="Show People Who Like This">' .$comment['Comment']['like_count'].'</a>';
				
			}
				
			
		?>
		</div><br /><?php }
	} else {
		echo "<b>There are no comments yet. Post one!</b>"; 	
	} 
	?>
</div>
<!--

<div class="users form actions" id="navigation">
	<center><p>Comment Navigation</p></center>
	<center><a class="actions prev"><<</a> || <a class="actions next">>></a></center>
</div> 

-->
<div class="users form">
	<h1>Add Comment</h1>
	<?php 
		echo $form->create('Comment', array('action' => 'add/' .$blog['Blog']['id']));
		echo $form->input('comment', array('rows' => 3));
		echo $form->submit('Comment!', array('id' => 'addComment'));
	?>
</div>

<div id="popup"></div>
